-
Notifications
You must be signed in to change notification settings - Fork 92
MPN and Datasheet assingment tool #226
base: master
Are you sure you want to change the base?
Conversation
Can't this be done already using the "Edit Symbol Fields" dialog in Eeschema? (related: #250) |
Yeah. One by one. This tool is about mass MPN assignment by matching values. |
I might be missing what you mean by mass assignment, because as far as I can tell, you can do mass assignment by matching values in the dialog I mentioned. Make sure that "Group By" is checked for exactly the fields you want to match (in your case, it looks like that would be "Value", "Footprint", and "Tolerance"), then set your MPN field for the groups you're interested in. Is this not essentially the same as what your script does? |
I may also be missing something? How do I get to this dialog in KiCad 5? |
In kicad 5 tools -> edit fields allows to group by value. you can then change other fields of such a group all at once. After entering the desired value in the group level the result looks like this: Okay @Ratfink was a bit faster than me. |
Ah, nice. Didn't know that. 👍 Is there also a way to run this as a pre commit hook or is it GUI only? |
I don't think it can be accessed from outside the GUI. Eeschema, unlike Pcbnew, is quite lacking in the scripting department. I suppose you may still want this script if running this as a Git hook is important to your workflow. I'd like to defer the question of whether this should be merged or not to #250, as I (personally) don't understand why the librarians should have to maintain scripts that have nothing to do with the libraries. |
I wrote a python script that allow the fast addition/change of the MPN field of every component of a schematic. The goal is to enable fast and consistent changes. This enables for example the switch from one part supplier to another without manually changing the schematic.
The script iterates over all components of a schematic and tries to find 100% matches of all field (except for MPN and Datasheet) in the supplied lookup table json file. A lookup table might look like this:
Also you could run this as a git commit hook.